package com.haruhi.bot.endpoint.ws;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.Set;

@Component
public class ConsumerStarter implements CommandLineRunner {

    private final Set<MessageHandler> handlers;

    public ConsumerStarter(Set<MessageHandler> handlers) {
        this.handlers = handlers;
    }

    @Override
    public void run(String... args) throws Exception {
        Consumer.start(handlers);
    }
}
